package cate.game.play.skill.passive.furniture;

import cate.game.play.config.PlayCfgArgs;
import cate.game.play.proce.action.ctx.ActionCtx;
import cate.game.play.skill.passive.PassiveHandler;

/**
 * 战斗开始前提升自身40%伤害减免，每回合衰减10%，最低至10%
 */
public class 固若金汤PH extends PassiveHandler {

	private int buff;

	private int 开始层数;

	private int 移除回合;

	//buff=？？&开始层数=4&移除回合=3
	@Override
	public void parse(String code) {
		PlayCfgArgs args = new PlayCfgArgs(code);
		buff = args.getInt("buff", 0);
		开始层数 = args.getInt("开始层数", 0);
		移除回合 = args.getInt("移除回合", 0);
	}

	@Override
	public void onFirstEnter(ActionCtx action) {
		skill.owner.buff.tryAddSome(action,buff,开始层数);
	}

	@Override
	public void onRoundEnd(ActionCtx action) {
		if (action.getRound().index <= 移除回合) {
			skill.owner.buff.removeBuffByTid(action, buff, 1);
		}
	}
}
